<?php
require("test_functions.php");
$res = mysql_query("select * from user_temp_result where u_id = '".$_SESSION['user_id']."'");
$row = mysql_fetch_array($res);
$ques_array = array();//array of questions
$titles_array = array();//array of titles of questions
$ques_array = quesToArray(mysql_query("select * from choices order by c_order"));
$titles_array = titlesToArray(mysql_query("select * from questions order by q_id"));

$questions = array();
$orders = array();

$count = 1;
while($count <= 25){
	$t_orders = array();
	$t_orders[$row["a".$count."_order"]-1] = 'checked';
	$orders[] = $t_orders;
		
	$questions[] = getFullQuestion($row["q".$count."_id"],$count,$ques_array,$titles_array);
	$count++;
}

$smarty -> assign('component', 'test');
$smarty -> assign('title','Test');
$smarty -> assign('questions', $questions);
$smarty -> assign('orders', $orders);
$smarty -> display('test.tpl');
?>